package tuanda.soict.firstsun.BuildingPackage;

/**
 * @author tuanda_soict_hut
 * @version 0.0.1
 * @since 6-8-2012
 */
public class HP_Building extends Gold_Building {

    private int hp_restore;

    public HP_Building(String nam, int def, int id, int groID,
            int obsPoint, int typ, int goldProd, int hp, int x, int y, int dataID) {
        super(nam, def, id, groID, obsPoint, typ, goldProd, x, y, dataID);
        setHPRestore(hp);
    }

    public final int getHPRestore() {
        return this.hp_restore;
    }

    public final void setHPRestore(int hp) {
        if (hp > 0 && hp < DEFAULT_UNIT_HEALTH) {
            this.hp_restore = hp;
        } else {
            this.hp_restore = DEFAULT_UNIT_HP_RESTORE;
        }
    }

    @Override
    public int getBuildingType() {
        return RESTORE_HP_TYPE;
    }
}
